﻿/**
 *
 * @title: Basic MVC Framework, CustomEvent Class
 * @author: Robert Turrall (http://www.robertturrall.com)
 * @license: Creative Commons Attribution 3.0 (http://creativecommons.org/licenses/by/3.0/)
 *			In other words: Please feel free to use, change, redistribute and do what you want with 
 *			this code. Just keep the original header and author attribution intact. Follow the license
 *			link for more info.
 * @updated: 31/12/2008
 *
 * @version	1.0 
 */

package net.turrall.mvc {
	
    import flash.events.Event;
	
    /**
	 * CustomEvent class to define custom Events
	 */
	public class CustomEvent extends Event {
		
		public var infoObj:Object;
		
        public function CustomEvent(type:String, bubbles:Boolean, cancelable:Boolean, obj:Object) {
            super(type, bubbles, cancelable);
			infoObj = obj;
        }
		
		public override function clone():Event {
			return new CustomEvent(this.type, this.bubbles, this.cancelable, this.infoObj);
		}
		
		public override function toString():String {
			return formatToString("CustomEvent", "type", "bubbles", "cancelable", "eventPhase", "infoObj");
		}
    }
}